import request from '@/utils/request'

const api = {
  addStandardDocUrl: '/qm_standard/add_standard_doc',
  updStandardDocUrl: '/qm_standard/update_standard_doc',
  getStandardPageUrl: '/qm_standard/get_standard_page',
  getCheckItemUrl: '/qm_standard/query_items',
  addCheckItemUrl: '/qm_standard/add_check_item',
  updCheckItemUrl: '/qm_standard/update_check_item',
  queryProcessModeUrl: '/qm_standard/query_process_mode',
}

export async function queryProcessModeApi(params: Map<string, any>) {
  const res = await request({
    url: api.queryProcessModeUrl,
    method: 'get',
    params,
  })
  return res
}

export async function addStandardDocApi(data: Map<string, any>) {
  const res = await request({
    url: api.addStandardDocUrl,
    method: 'post',
    data,
  })
  return res
}

export async function updStandardDocApi(data: Map<string, any>) {
  const res = await request({
    url: api.updStandardDocUrl,
    method: 'post',
    data,
  })
  return res
}

export async function getStandardPageApi(data: Map<string, any>) {
  const res = await request({
    url: api.getStandardPageUrl,
    method: 'post',
    data,
  })
  return res
}

export async function getCheckItemApi(params: Map<string, any>) {
  const res = await request({
    url: api.getCheckItemUrl,
    method: 'get',
    params,
  })
  return res
}

export async function addCheckItemApi(data: Map<string, any>) {
  const res = await request({
    url: api.addCheckItemUrl,
    method: 'post',
    data,
  })
  return res
}

export async function updCheckItemApi(data: Map<string, any>) {
  const res = await request({
    url: api.updCheckItemUrl,
    method: 'post',
    data,
  })
  return res
}
